<template>
  <section
    @click="clickCurrent('current')"
    @mousedown="clickCurrent('dragging')"
  >
    <div :class="['custorm--modelbox', 'graphictitle-show', (custormCurrent == custormIndex)?'drag active':'drag']">
      <div
        v-if="custormItemData.params.isshow == '2'"
        class="noshow"
        v-bind:style="{'background-image':`url(${getPath('noshow.png')})`}"
      ></div>
      <div
        style="overflow: hidden;"
        v-if="custormItemData.style.display == '1'"
      >
        <div
          class="es-title title1"
          :style="{'margin':custormItemData.style.margincol+'px '+custormItemData.style.marginrow+'px'}"
        >
          <div class="flex-row flex-justify-b flex-align-c">
            <div class="title-content">
              <div
                class="main-title"
                :style="{'color':custormItemData.style.maincolor}"
              >{{custormItemData.params.maintext}}</div>
              <div
                class="sub-title"
                :style="{'color':custormItemData.style.subcolor}"
              >{{custormItemData.params.subtext}}</div>
            </div>
            <div
              class="title-more"
              v-if="custormItemData.params.showmore == 1"
              :style="{'color':custormItemData.style.morecolor}"
            >查看更多<i class="el-icon-arrow-right"></i></div>
          </div>
        </div>
      </div>
      <div
        style="overflow: hidden;"
        v-if="custormItemData.style.display == '2'"
      >
        <div
          class="es-title title2"
          :style="{'margin':custormItemData.style.margincol+'px '+custormItemData.style.marginrow+'px'}"
        >
          <div class="flex-row">
            <div
              class="main-title"
              :style="{'color':custormItemData.style.maincolor}"
            >{{custormItemData.params.maintext}}</div>
            <div
              class="sub-title"
              :style="{'color':custormItemData.style.subcolor}"
            >{{custormItemData.params.subtext}}</div>
          </div>
        </div>
      </div>
      <div
        style="overflow: hidden;"
        v-if="custormItemData.style.display == '3'"
      >
        <div
          class="es-title title3"
          :style="{'margin':custormItemData.style.margincol+'px '+custormItemData.style.marginrow+'px'}"
        >
          <div class="flex-col flex-justify-c flex-align-c">
            <div class="main-title flex-row flex-align-c">
              <span></span>
              <div
                class="main-title"
                :style="{'color':custormItemData.style.maincolor}"
              >{{custormItemData.params.maintext}}</div>
              <span></span>
            </div>
            <div
              class="sub-title"
              :style="{'color':custormItemData.style.subcolor}"
            >{{custormItemData.params.subtext}}</div>
          </div>
        </div>
      </div>
      <div
        class="btn-edit-del"
        @click="delCurrent"
      ><span class="btn-del iconfont icon icon-close"></span></div>
    </div>
  </section>
</template>

<script>
import defaultConfig from './utils/showConfig'
export default {
  mixins: [defaultConfig.mixins],
  props: {
    defaultConfig: {
      type: Object,
      default: function() {
        return defaultConfig
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.custorm--modelbox.graphictitle-show {
  .es-title,
  .es-title.title2,
  .es-title.title12,
  .es-title.title13 {
    position: relative;
  }

  .es-title {
    margin: 12px;
    font-size: 16px;
    font-weight: 700;
  }

  .es-title.title1 .title,
  .es-title.title12 .title,
  .es-title.title13 .title {
    padding: 0 10px;
    position: relative;
    background: #fff;
    z-index: 2;
  }

  .es-title .title-more {
    font-size: 13px;
    color: #999999;
    font-weight: normal;
  }

  .es-title .sub-title {
    font-size: 13px;
    color: #999999;
    font-weight: normal;
  }

  .es-title.title2 {
    .flex-row {
      align-items: baseline;
    }
    .sub-title {
      margin-left: 6px;
    }
  }

  .es-title.title3 {
    .main-title span {
      display: inline-block;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: #ffd940;
      border: 1px solid transparent;
      position: relative;
      margin: 0 10px;
    }
    .main-title span::after {
      content: " ";
      position: absolute;
      top: -2px;
      left: -2px;
      width: 5px;
      height: 5px;
      border: 1px solid #333333;
      border-radius: 50%;
    }
  }
}
</style>
